<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="author" content="李愧愧">
    <title></title>
    <style>
        .box {
            width: 800px;
            height: 800px;
            background-image: url(./img/watch.jpg);
            background-size: 100%;
            margin: auto;
            position: relative;
        }

        .box .hour {
            height: 200px;
            width: 10px;
            background-color: brown;
            position: absolute;
            top: 220px;
            left: 396px;
            border-radius: 10px;
            animation: move 5s linear infinite;
            transform-origin: 50% 89%;
            /* transform: rotate(30deg); */
        }

        .box .minute {
            height: 240px;
            width: 8px;
            background-color: darkgreen;
            border-radius: 10px;
            position: absolute;
            top: 190px;
            left: 397px;
            transform-origin: 50% 87%;
            animation: move 5s linear infinite;
            /* transform: rotate(30deg); */
        }

        .box .second {
            width: 5px;
            height: 340px;
            background-color: blue;
            border-radius: 10px;
            position: absolute;
            top: 100px;
            left: 398px;
            transform-origin: 50% 88%;
            animation: move 5s linear infinite;

        }

        .box .bc {
            width: 20px;
            height: 20px;
            background-color: black;
            border-radius: 50%;
            position: absolute;
            top: calc(50% - 10px);
            left: calc(50% - 10px);
            z-index: 1;

        }

        /* @keyframes move {
            0%{ 
                transform: rotate(0deg);
            }
            100%{
                transform: rotate(360deg);
            }
        } */
    </style>
</head>

<body>
    <div class="box">
        <div class="bc">
        </div>
        <div class="hour">
        </div>
        <div class="minute">
        </div>
        <div class="second">
        </div>
    </div>
    <script>
        var hour = document.querySelector('.hour');
        var minute = document.querySelector('.minute');
        var second = document.querySelector('.second');
        function updataTime() {
            var now = new Date();
            var xiaoshi = now.getHours();
            var fenzhong = now.getMinutes();
            var miao = now.getSeconds();
            xiaoshi = xiaoshi % 12;
            console.dir(xiaoshi);
            console.dir(fenzhong);
            console.dir(miao);
            // console.dir(maiozhuandong);
            second.style.transform = "rotate(" + miao * 6 + "deg)";
            minute.style.transform = "rotate(" + fenzhong * 6 + "deg)";
            hour.style.transform = "rotate(" + xiaoshi * 30 + "deg)";

        }
        updataTime();
        setInterval(updataTime, 1000);
    </script>
</body>

</html>